import 'package:flutter/material.dart';

class UserInfo {
  final String account_id;//账号ID
  final String account;//账号
  final String avatar;//头像
  final String nickname;//昵称
  final String city_name_cn;
  final String city;
  final String country;
  final String province;
  final String unique_id;
  final String token;//接口令牌
  final String openid;
  final String udid;
  final String platform;
  final String ip;

  UserInfo({
    required this.account_id,
    required this.account,
    required this.avatar,
    required this.nickname,
    required this.city_name_cn,
    required this.city,
    required this.country,
    required this.province,
    required this.unique_id,
    required this.token,
    required this.openid,
    required this.udid,
    required this.platform,
    required this.ip,
  });

  @override
  String toString() {
    return 'UserInfo{account_id: $account_id, account: $account, avatar: $avatar, nickname: $nickname, city_name_cn: $city_name_cn, city: $city, country: $country, province: $province, unique_id: $unique_id, token: $token, openid: $openid, udid: $udid, platform: $platform, ip: $ip}';
  }

  factory UserInfo.fromJson(Map<String, dynamic> json) {
    return UserInfo(
      account_id: json['account_id'],
      account: json['account'],
      avatar: json['avatar'],
      nickname: json['nickname'],
      city_name_cn: json['city_name_cn'],
      city: json['city'],
      country: json['country'],
      province: json['province'],
      unique_id: json['unique_id'],
      token: json['token'],
      openid: json['openid'],
      udid: json['udid'],
      platform: json['platform'],
      ip: json['ip'],
    );
  }
}
